#pragma once

#include <SFML/Graphics.hpp>
#include <vector>
#include <ctime>
#include <iostream>
#include <memory>
#include "collision.h"

class Character {
public:
    sf::Clock clock1;
    bool unstoppable;
    float unstoppableStartTime;
    int health;
    int powernumber;
    int shield;
    float speed;
    bool hasDog;
    float accelerationTimer;
    float speedLimit;
    int score;
    float lastsocreTime;
    int coins;
    sf::Sprite appearance;
    //sf::Sprite* appearance;
    std::vector<sf::Sprite> appearanceSprites;
    std::vector<sf::Texture> appearanceTextures;
    std::vector<sf::Sprite> healthSprites;
    std::vector<sf::Texture> healthTextures;
    std::vector<sf::Sprite> powerSprites;
    std::vector<sf::Texture> powerTextures;
    int direction;
    bool isAccelerating;
    float accelerationStartTime;
    bool isHurting;
    float hurtStartTime;
    bool isFlying;
    float flyStartTime;
    sf::FloatRect hitbox;
    bool hasTouchedOctopus;
    Character(sf::Texture& texture, std::vector<sf::Texture> appearanceTextures, std::vector<sf::Texture> ures, std::vector<sf::Texture> ceTextures);
    float getHealth();
    void setHealth(int h);
    int getdirection();
    void setdirection(int a);
    void update(sf::RenderWindow& window);
    void takeDamage();
    void encounterOctopus();
    void encounterPowerup();
    void encounterHealth();
    double checkCollision(const std::vector<sf::Sprite>& obstacles,  std::vector<sf::Sprite>& powerups,  std::vector<sf::Sprite>& healths,bool isunstoppable);
};